We accept NO RESPONSIBILITY if you destroy any of your movies by AppleScripting MyVidEditor. It is possible to specify that the source and destination movies are the same (same file names and locations), which could result in unpredictable behaviour and COULD Potentially overwrite your source movie. Be very careful with your file naming and paths. ALL WAYS check the result code (true or false) from ALL of our applescript commands before proceeding to do something with the resulting movie or you may get into trouble.
Note that we almost always use a Result movie that you create rather than adding into a source movie, which should prevent you from accidentally changing your source movies. We also chose to use reference movies, which means you could add 10 movies together and only use up say 10 to 50 k of disk space to do this, rather than 100's of megabytes if we copy all the data from a movie and saved it self contained. Be aware of the fact that the result movie is usually a reference movie, and if you delete the movies it's dependent on, the result will not be playable afterwards.
Apple Scripting MyVideoEditor
There are 7 apple script commands available MyVidEditor that allow you to:
1) Select one of your Settings by number (so you can change the compression settings before compressing a movie or project).
2) Compress an existing Movie Project (saving it either self contained or as a reference movie).
3) Compress a movie
4) Flatten a movie (either as a Mac movie or a Cross platform movie) and make it self contained.
5) Extract specific tracks from a movie
6) Add 2 movies together and create a reference movie from them (flatten it to make it self contained)
7) Copy specific tracks from a movie, add them to another movie and create a reference movie from them (flatten it to make it self contained).
There are a few example scripts in the MVE Scripts folder that you can use or modify for your own purpose.
Changing Compression Settings
"Select Settings x" allows you to set the current compression settings (compressor, quality, frame rates, keyframe rates etc.) by number. The Number you specify corresponds to the order the named settings items displayed in the Options Menu > Settings submenu (below the separator), so a "1" would select the first settings you've created, a "2" would select your second settings and so on. the Select Settings command will return "True" if it succeeded or "False" if it didn't.
So if you had created 4 settings (My Internet, My Preview, Clients 15FPS Final and Clients 30FPS Final) and you want to compress a movie with "My Preview" settings (the second item in the menu), you would use the following:
Select Settings 2
Compressing Projects
"Compress project <source > to movie <result > [as self contained yes/no]"allows you to open a movie project, compress it and then save the result to a new movie. The optional parameter "as self contained" allows you to specify whether you are making a reference movie (which means only the movie effects are actually compressed) or you want the entire movie project to be compressed (as self contained yes).
So to compress a project and save it as a reference movie, you'd use the following:
Compress project file "Macintosh HD:ThisFolder:thisproject" to movie file "OtherHD:myRefMovie"
Note that we did not use "as self contained no" (this is an optional parameter and if we don't specify it, you automatically get a reference movie) and that we placed the word "file" before each of the actual file names. The word "file" is REQUIRED before the actual file name to force AppleScript to send the command the correct object type.
To Compress a project as self contained movie, you'd use the following:
Compress project file "Macintosh HD:ThisFolder:thisproject" to movie file"OtherHD:MyMovie" as self contained yes
Compressing Movies
"Compress movie <source> to movie <result >"allows you to open a movie, compress it and then save the result to a new movie. You'd use it like the following (yes you need to add the "file" before the actual movie names):
Compress movie file "Macintosh HD:ThisFolder:thisproject" to movie file "OtherHD:TheOtherFolder:mycompressedMovie"
Flattening Movies
"Flatten movie <source> to movie <result > [as cross platform yes/no]"allows you to open a movie, flatten it and then save the result to a new movie. Flattening removing all movie references, optimizing the audio interleave and making the movie "Self Contained". The optional "as cross platform yes/no" parameter allows you to specify whether the movie should be created only for the Mac (don't use it or use the word "no") or the resource and data fork should be merged together so the movie can be be played on Mac and Non-Mac computers.
So to flatten a movie for a Mac you use:
Flatten movie file "Macintosh HD:ThisFolder:thismovie" to movie file "OtherHD:TheOtherFolder:mycompressedMovie"
To flatten a movie and make it cross platform compatible (Macs and PCs):
Flatten movie file "Macintosh HD:ThisFolder:thismovie" to movie file "OtherHD:TheOtherFolder:dumbdos.mov" as cross platform yes
Adding Two Movies Together
"Add movie <source2> with movie <source> to movie <result >" will add source1 movie to the end of source movie and then create a reference / dependent movie that has both in it. You'll have to Flatten the result movie it to remove the referenced movies and make it self contained.
Add movie file "Macintosh HD:second" with movie file "Macintosh HD:first" to movie file "OtherHD:bothmovies"
So the above example adds the second to the first movie and saves it to bothMovies.
Extracting Specific Tracks from Movies
"Extract track <tracktype> from movie <source > to movie <result> [Compress AIFF yes/no]" allows you to open a movie, extract a particular track (video/audio/midi/sprite/QD3D/AIFF etc.) from it and then save this track into a new movie. If you are extracting an AIFF sound file from the audio part of a movie, you can optionally have it compressed/converted using MVE's default sound compression settings (Edit Menu > Sound Prefs…). If the track you ask for is not present in the source movie, Extract Track returns false and you shouldn't try and do anything with the result movie (it will not be created).
Extract track AIFF from movie file "Macintosh HD:ThisFolder:thismovie" to movie file "OtherHD:TheOtherFolder:aiff.mov" Compress AIFF yes
The above will extract the audio tracks of a movie as an AIFF file, compress/convert the audio using your sound preferences and save it as an AIFF file. If the "Compress AIFF yes" parameter is specified, the actual sound data WILL be contained in the AIFF file (the sound is actually being converted, not just copied, so it has to be contained).
Adding Specific Tracks to Movies
"Add track <tracktype> from movie <source2 > with movie <source> to movie <result>" is very similar to Add movie, except you can specify what type of tracks (video/audio/AIFF/QD3D/Midi etc.) you want to add to the result movie. If the track you ask for is not present in the source2 movie, Add Track returns false and you shouldn't try and do anything with the result movie (the result will not be created).
Add track midi from movie file "Macintosh HD:midmovie" with movie file "Macintosh HD:vidmovie" to movie file "OtherHD:mergedmovie"
This copies a midi track from "midmovie", combines it with the existing tracks in "vidmovie" and saves it as a reference movie in "mergedmovie"